TARGET=demo
OBJS=main.o

TITLE=`basename $(PWD)`

CFLAGS=`pkg-config --cflags glib-2.0`
LDFLAGS=`pkg-config --libs glib-2.0`

.PHONY: all $(TARGET) prepare

all: prepare $(TARGET)

$(TARGET):$(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)

prepare:
	@echo "#define TITLE \"$(TITLE)\"" > common.h

clean:
	rm -rf $(OBJS) $(TARGET)
